﻿@inject NavigationManager NavigationManager;

<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
    <Found Context="routeData">
        <AuthorizeRouteView RouteData="@routeData"
                            DefaultLayout="@typeof(MainLayout)">
            <NotAuthorized>
                <h1>Sorry</h1>
                <p>You're not authorized to reach this page.</p>
                <p>Please <NavLink href=@NavigationManager.GetLoginUrl()>login</NavLink> as a different user.</p>
            </NotAuthorized>
            
            <Authorizing>
                <p class="text-muted" style="float:right;margin:1rem 1rem 0 0">Authenticating...</p>
                <RouteView RouteData="@routeData" />
            </Authorizing>

        </AuthorizeRouteView>
    </Found>
    <NotFound>
        <LayoutView Layout="@typeof(MainLayout)">
            <p>Sorry, there's nothing at this address.</p>
        </LayoutView>
    </NotFound>
</Router>
